{template "header.html"}

<div class="page-content">

    <div class="container">

        <ul class="page-breadcrumb breadcrumb">
            <li class="symbol-title">
                <a href="{SITE_URL}">网站首页</a>
                <i class="fa fa-circle"></i>
            </li>
            {dr_catpos($catid, '', true, '<li><a href="[url]">[name]</a><i class="fa fa-circle"></i></li>')}
            <li>
                <span>搜索</span>
            </li>
        </ul>

        <div class="search-page search-content-3">

            <div class="portlet light" style="padding: 0;">
                <div class="portlet-body form fc-search-param">
                    <div class="form-body">
                        <div class="form-group row">
                            <label class="col-md-1">作品分类</label>
                            <div class="col-md-9">
                                <label><a class="label {if !$cat || $cat.child}label-success{else}label-default{/if}" href="{Router::search_url($params, 'catid', NULL)}">不限</a></label>
                                <!--调用栏目分类，这种用法只能用于模块列表与搜索页面-->
                                {loop $related $t}
                                <label><a class="label {if $t.id==$cat.id}label-success{else}label-default{/if}" href="{Router::search_url($params, 'catid', $t.id)}">{$t.name}</a></label>
                                {/loop}
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-md-1">连载状态</label>
                            <div class="col-md-9">
                                <label><a class="label {if !$params.zt}label-success{else}label-default{/if}" href="{Router::search_url($params, 'zt', NULL)}">不限</a></label>
                                <!--调用单选字段数据方法-->
                                {php $field = dr_field_options($ci->module['field']['zt']['id']);unset($field[0]);}
                                {loop $field $value $name}
                                <label><a class="label {if $value==$params.zt}label-success{else}label-default{/if}" href="{Router::search_url($params, 'zt', $value)}">{$name}</a></label>
                                {/loop}
                            </div>
                        </div>




                    </div>
                </div>
            </div>

            <div class="portlet light" style="padding: 0;">
                <div class="portlet-title">
                    <div class="caption">
                        <span class="caption-subject font-green-sharp"> 全部书籍 </span>
                    </div>
                    <div class="actions">
                        <div class="btn-group">
                            <a href="{Router::search_url($params, 'order', null)}" class="btn btn-default {if !$params.order || $param.order=='updatetime'}active{/if}"> <i class="fa fa-clock-o"></i> 时间排序 </a>
                            <a href="{Router::search_url($params, 'order', 'hits')}" class="btn btn-default {if $params.order=='hits'}active{/if}"> <i class="icon-fire"></i> 点击排序 </a>
                            <a href="{Router::search_url($params, 'order', 'comments')}" class="btn btn-default {if $params.order=='comments'}active{/if}"> <i class="fa fa-comments-o"></i> 评论排序 </a>
                            <a href="{Router::search_url($params, 'order', 'avgsort')}" class="btn btn-default {if $params.order=='avgsort'}active{/if}"> <i class="fa fa-diamond"></i> 评分排序 </a>
                            <a href="{Router::search_url($params, 'order', 'support')}" class="btn btn-default {if $params.order=='support'}active{/if}"> <i class="fa fa-digg"></i> 支持量排序 </a>

                        </div>
                    </div>
                </div>
                <div class="portlet-body search-container ">
                    <div class="row">
                        <!--调用MOD_DIR模块的数据 id和total和order参数(本页面固有参数) page=1标示开启分页 urlrule分页地址规则 pagesize每页数量-->
                        {search module=MOD_DIR id=$searchid total=$sototal order=$params.order catid=$catid  page=1 pagesize=16 urlrule=$urlrule}
                        <div class="col-md-3">
                            <div class="tile-container">
                                <div class="tile-thumbnail">
                                    <a href="{$t.url}">
                                        <img src="{dr_thumb($t.thumb, 230, 230)}">
                                        <div class="{if $t.zt}zt1{else}zt0{/if}"></div>
                                    </a>
                                </div>
                                <div class="tile-title">
                                    <h3>
                                        <a href="{$t.url}">{$t.title}</a>
                                    </h3>
                                    <a href="javascript:dr_module_book('{MOD_DIR}', '{$t.id}');">
                                        <i class="icon-plus font-blue"></i>
                                    </a>

                                    <div class="tile-desc">
                                        <p>{dr_strcut($t.description, 60)}</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/search}
                    </div>


                    {if !$count}
                    <div class="row fc-search-null">
                        <div class="col-md-12 text-center">
                            <i class="icon-close fc-search-null-icon"></i>
                            <label class="fc-search-null-txt">没有找到相关内容...</label>
                        </div>

                    </div>
                    {/if}
                    <div class="search-pagination">
                        <ul class="pagination">
                            {$pages}
                        </ul>
                    </div>
                </div>
            </div>
        </div>

    </div><script>

    // 加入书架
    function dr_module_book(dir, id) {
        $.get("/index.php?is_ajax=1&s="+dir+"&c=show&m=cart&id="+id, function(data){
            dr_tips(data.code, data.msg);
            if (data.code) {
                $('#module_book_'+id).html(data.data);
            }
        }, 'json');
    }
</script>

</div>

{template "footer.html"}